
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#include <drv_matrix_led.h>
#include "demo.h"

/* define LED  */

rt_thread_t led_matrix_thread;


static void led_matrix_entry(void *parameter)
{
    float distance;
    led_matrix_clear();
    while(1)
    {
        if (rt_mq_recv(&mq_led, &distance, sizeof(float), RT_WAITING_FOREVER)==RT_EOK)
        {
            if (distance<10.0f) {
                led_matrix_fill(GREEN, 0, 1);
            }else{led_matrix_fill(BLUE, 0, 1);}

         }
        rt_thread_mdelay(500);
    }
}
